package com.itheima.dao;

import com.itheima.pojo.Dept;
import com.itheima.pojo.Emp;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DeptMapper {

    /**
     * 获取部门数据
     * @return
     */
    @Select(" select id, name, create_time as 'createTime', update_time as 'updateTime' from tlias.dept")
    List<Dept> findAllDept();

    /**
     * 根据id删除部门信息
     * @param id
     */
    @Delete("delete from tlias.dept where id=#{id}")
    void delete(Integer id);

    /**
     * 添加员工
     * @param dept
     */
    void add(Dept dept);

    void updateDept(Dept dept);

    /**
     * 通过id查询部门信息
     * @param id
     * @return
     */
    Dept findDeptById(Integer id);


    void deleteDeptById(Integer id);





}
